package listeners;

import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.awt.geom.AffineTransform;
import java.awt.geom.GeneralPath;

import view.DrawPanel;
import view.Line;
import view.PictureModel;

public class SightMouseMotionListener  extends MouseMotionAdapter{
	
	public static Point previous;
	private DrawPanel paint;
	private PictureModel pictureModel;
	private GeneralPath path;
	public SightMouseMotionListener(DrawPanel paint, PictureModel pictureModel, GeneralPath path){
		this.paint = paint;
		this.pictureModel = pictureModel;
		this.path = path;
	}
	@Override
	public void mouseMoved(MouseEvent event){
		Point point = event.getPoint();
		paint.clear();
		pictureModel.draw();
		pictureModel.drawControlPoints();
		paint.getGraphics2D().draw(path);
		Line.drawSight(paint.getGraphics2D(), point);
		paint.repaint();
		previous = point;
	}
}
